<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::Settings - bundler: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-key_for">::key_for</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-c-normalize_uri">::normalize_uri</a>
    <li ><a href="#method-i-5B-5D">#[]</a>
    <li ><a href="#method-i-all">#all</a>
    <li ><a href="#method-i-app_cache_path">#app_cache_path</a>
    <li ><a href="#method-i-array_to_s">#array_to_s</a>
    <li ><a href="#method-i-configs">#configs</a>
    <li ><a href="#method-i-converted_value">#converted_value</a>
    <li ><a href="#method-i-credentials_for">#credentials_for</a>
    <li ><a href="#method-i-gem_mirrors">#gem_mirrors</a>
    <li ><a href="#method-i-global_config_file">#global_config_file</a>
    <li ><a href="#method-i-ignore_config-3F">#ignore_config?</a>
    <li ><a href="#method-i-is_array">#is_array</a>
    <li ><a href="#method-i-is_bool">#is_bool</a>
    <li ><a href="#method-i-is_credential">#is_credential</a>
    <li ><a href="#method-i-is_num">#is_num</a>
    <li ><a href="#method-i-is_string">#is_string</a>
    <li ><a href="#method-i-is_userinfo">#is_userinfo</a>
    <li ><a href="#method-i-key_for">#key_for</a>
    <li ><a href="#method-i-load_config">#load_config</a>
    <li ><a href="#method-i-local_config_file">#local_config_file</a>
    <li ><a href="#method-i-local_overrides">#local_overrides</a>
    <li ><a href="#method-i-locations">#locations</a>
    <li ><a href="#method-i-mirror_for">#mirror_for</a>
    <li ><a href="#method-i-parent_setting_for">#parent_setting_for</a>
    <li ><a href="#method-i-path">#path</a>
    <li ><a href="#method-i-pretty_values_for">#pretty_values_for</a>
    <li ><a href="#method-i-printable_value">#printable_value</a>
    <li ><a href="#method-i-processor_count">#processor_count</a>
    <li ><a href="#method-i-serializer_class">#serializer_class</a>
    <li ><a href="#method-i-set_command_option">#set_command_option</a>
    <li ><a href="#method-i-set_command_option_if_given">#set_command_option_if_given</a>
    <li ><a href="#method-i-set_global">#set_global</a>
    <li ><a href="#method-i-set_key">#set_key</a>
    <li ><a href="#method-i-set_local">#set_local</a>
    <li ><a href="#method-i-specific_gem_for">#specific_gem_for</a>
    <li ><a href="#method-i-split_specific_setting_for">#split_specific_setting_for</a>
    <li ><a href="#method-i-temporary">#temporary</a>
    <li ><a href="#method-i-to_array">#to_array</a>
    <li ><a href="#method-i-to_bool">#to_bool</a>
    <li ><a href="#method-i-validate-21">#validate!</a>
    <li ><a href="#method-i-value_for">#value_for</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::Settings">
    <h1 id="class-Bundler::Settings" class="class">
      class Bundler::Settings
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="ARRAY_KEYS">ARRAY_KEYS
          <dd>
          <dt id="BOOL_KEYS">BOOL_KEYS
          <dd>
          <dt id="DEFAULT_CONFIG">DEFAULT_CONFIG
          <dd>
          <dt id="NORMALIZE_URI_OPTIONS_PATTERN">NORMALIZE_URI_OPTIONS_PATTERN
          <dd>
          <dt id="NUMBER_KEYS">NUMBER_KEYS
          <dd>
          <dt id="PER_URI_OPTIONS">PER_URI_OPTIONS
          <dd>
          <dt id="Path">Path
          <dd>
          <dt id="STRING_KEYS">STRING_KEYS
          <dd>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(root = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 90</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">root</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@root</span>            = <span class="ruby-identifier">root</span>
  <span class="ruby-ivar">@local_config</span>    = <span class="ruby-identifier">load_config</span>(<span class="ruby-identifier">local_config_file</span>)

  <span class="ruby-ivar">@env_config</span>      = <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">to_h</span>
  <span class="ruby-ivar">@env_config</span>.<span class="ruby-identifier">select!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">_value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;BUNDLE_&quot;</span>) }
  <span class="ruby-ivar">@env_config</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">&quot;BUNDLE_&quot;</span>)

  <span class="ruby-ivar">@global_config</span>   = <span class="ruby-identifier">load_config</span>(<span class="ruby-identifier">global_config_file</span>)
  <span class="ruby-ivar">@temporary</span>       = {}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Class Methods</h3>
                </header>

                  <div id="method-c-key_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">key_for</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="key_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 513</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">key_for</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">normalize_uri</span>(<span class="ruby-identifier">key</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;http&quot;</span>, <span class="ruby-string">&quot;mirror.http&quot;</span>)
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&quot;.&quot;</span>, <span class="ruby-string">&quot;__&quot;</span>)
  <span class="ruby-identifier">key</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-string">&quot;-&quot;</span>, <span class="ruby-string">&quot;___&quot;</span>)
  <span class="ruby-identifier">key</span>.<span class="ruby-identifier">upcase!</span>

  <span class="ruby-identifier">key</span>.<span class="ruby-identifier">prepend</span>(<span class="ruby-string">&quot;BUNDLE_&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-normalize_uri" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalize_uri</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>TODO: duplicates Rubygems#normalize_uri TODO: is this the correct place to validate mirror URIs?</p>

                              <div class="method-source-code" id="normalize_uri-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 524</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">normalize_uri</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">NORMALIZE_URI_OPTIONS_PATTERN</span>
    <span class="ruby-identifier">prefix</span> = <span class="ruby-node">$1</span>
    <span class="ruby-identifier">uri</span> = <span class="ruby-node">$2</span>
    <span class="ruby-identifier">suffix</span> = <span class="ruby-node">$3</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URINormalizer</span>.<span class="ruby-identifier">normalize_suffix</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;vendored_uri&quot;</span>
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">absolute?</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-identifier">format</span>(<span class="ruby-string">&quot;Gem sources must be absolute. You provided &#39;%s&#39;.&quot;</span>, <span class="ruby-identifier">uri</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-node">&quot;#{prefix}#{uri}#{suffix}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-5B-5D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">[]</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="5B-5D-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 102</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">[]</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">name</span>)

  <span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">configs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_</span>, <span class="ruby-identifier">config</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">value</span> = <span class="ruby-identifier">config</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">break</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">converted_value</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-all" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">all</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="all-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 152</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">all</span>
  <span class="ruby-identifier">keys</span> = <span class="ruby-ivar">@temporary</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">union</span>(<span class="ruby-ivar">@global_config</span>.<span class="ruby-identifier">keys</span>, <span class="ruby-ivar">@local_config</span>.<span class="ruby-identifier">keys</span>, <span class="ruby-ivar">@env_config</span>.<span class="ruby-identifier">keys</span>)

  <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">delete_prefix</span>(<span class="ruby-string">&quot;BUNDLE_&quot;</span>)
    <span class="ruby-identifier">key</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-string">&quot;___&quot;</span>, <span class="ruby-string">&quot;-&quot;</span>)
    <span class="ruby-identifier">key</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-string">&quot;__&quot;</span>, <span class="ruby-string">&quot;.&quot;</span>)
    <span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase!</span>
    <span class="ruby-identifier">key</span>
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">sort!</span>
  <span class="ruby-identifier">keys</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-app_cache_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">app_cache_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="app_cache_path-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 301</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">app_cache_path</span>
  <span class="ruby-ivar">@app_cache_path</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">self</span>[<span class="ruby-value">:cache_path</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;vendor/cache&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-credentials_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">credentials_for</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="credentials_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 182</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">credentials_for</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-keyword">self</span>[<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>[<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gem_mirrors" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_mirrors</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_mirrors-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 186</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem_mirrors</span>
  <span class="ruby-identifier">all</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-constant">Mirrors</span>.<span class="ruby-identifier">new</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mirrors</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mirrors</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">k</span>, <span class="ruby-keyword">self</span>[<span class="ruby-identifier">k</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;mirror.&quot;</span>)
    <span class="ruby-identifier">mirrors</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ignore_config-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ignore_config?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ignore_config-3F-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 297</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ignore_config?</span>
  <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_IGNORE_CONFIG&quot;</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-key_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">key_for</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="key_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 314</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">key_for</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">key</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-local_overrides" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">local_overrides</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="local_overrides-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 165</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">local_overrides</span>
  <span class="ruby-identifier">repos</span> = {}
  <span class="ruby-identifier">all</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">repos</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">delete_prefix</span>(<span class="ruby-string">&quot;local.&quot;</span>)] = <span class="ruby-keyword">self</span>[<span class="ruby-identifier">k</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;local.&quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">repos</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-locations" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">locations</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="locations-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 193</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">locations</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">configs</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">partial_locations</span>, <span class="ruby-identifier">level</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">value_on_level</span> = <span class="ruby-identifier">configs</span>[<span class="ruby-identifier">level</span>][<span class="ruby-identifier">key</span>]
    <span class="ruby-identifier">partial_locations</span>[<span class="ruby-identifier">level</span>] = <span class="ruby-identifier">value_on_level</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value_on_level</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">partial_locations</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-mirror_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">mirror_for</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="mirror_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 173</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mirror_for</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
    <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;vendored_uri&quot;</span>
    <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">gem_mirrors</span>.<span class="ruby-identifier">for</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">uri</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>for legacy reasons, in <a href="../Bundler.html"><code>Bundler</code></a> 2, we do not respect :disable_shared_gems</p>

                              <div class="method-source-code" id="path-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 235</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">path</span>
  <span class="ruby-identifier">configs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_level</span>, <span class="ruby-identifier">settings</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">path</span> = <span class="ruby-identifier">value_for</span>(<span class="ruby-string">&quot;path&quot;</span>, <span class="ruby-identifier">settings</span>)
    <span class="ruby-identifier">path_system</span> = <span class="ruby-identifier">value_for</span>(<span class="ruby-string">&quot;path.system&quot;</span>, <span class="ruby-identifier">settings</span>)
    <span class="ruby-identifier">disabled_shared_gems</span> = <span class="ruby-identifier">value_for</span>(<span class="ruby-string">&quot;disable_shared_gems&quot;</span>, <span class="ruby-identifier">settings</span>)
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">path_system</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">disabled_shared_gems</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">system_path</span> = <span class="ruby-identifier">path_system</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">disabled_shared_gems</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">false</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-constant">Path</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">system_path</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">path</span> = <span class="ruby-string">&quot;vendor/bundle&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>[<span class="ruby-value">:deployment</span>]

  <span class="ruby-constant">Path</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>, <span class="ruby-keyword">false</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pretty_values_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pretty_values_for</span><span
                                class="method-args">(exposed_key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pretty_values_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 202</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pretty_values_for</span>(<span class="ruby-identifier">exposed_key</span>)
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">exposed_key</span>)

  <span class="ruby-identifier">locations</span> = []

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span> = <span class="ruby-ivar">@temporary</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Set for the current command: #{printable_value(value, exposed_key).inspect}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span> = <span class="ruby-ivar">@local_config</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Set for your local app (#{local_config_file}): #{printable_value(value, exposed_key).inspect}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span> = <span class="ruby-ivar">@env_config</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Set via #{key}: #{printable_value(value, exposed_key).inspect}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span> = <span class="ruby-ivar">@global_config</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Set for the current user (#{global_config_file}): #{printable_value(value, exposed_key).inspect}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> [<span class="ruby-node">&quot;You have not configured a value for `#{exposed_key}`&quot;</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">locations</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">locations</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-processor_count" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">processor_count</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="processor_count-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 227</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">processor_count</span>
  <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;etc&quot;</span>
  <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">nprocessors</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span>
  <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_command_option" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_command_option</span><span
                                class="method-args">(key, value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_command_option-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 115</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_command_option</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">feature_flag</span>.<span class="ruby-identifier">forget_cli_options?</span>
    <span class="ruby-identifier">temporary</span>(<span class="ruby-identifier">key</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">value</span>)
    <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">set_local</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_command_option_if_given" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_command_option_if_given</span><span
                                class="method-args">(key, value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_command_option_if_given-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 124</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_command_option_if_given</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-identifier">set_command_option</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_global" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_global</span><span
                                class="method-args">(key, value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_global-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 148</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_global</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-identifier">set_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-ivar">@global_config</span>, <span class="ruby-identifier">global_config_file</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_local" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_local</span><span
                                class="method-args">(key, value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_local-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 129</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_local</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-identifier">local_config_file</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">raise</span>(<span class="ruby-constant">GemfileNotFound</span>, <span class="ruby-string">&quot;Could not locate Gemfile&quot;</span>)

  <span class="ruby-identifier">set_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-ivar">@local_config</span>, <span class="ruby-identifier">local_config_file</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-temporary" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">temporary</span><span
                                class="method-args">(update) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="temporary-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 135</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">temporary</span>(<span class="ruby-identifier">update</span>)
  <span class="ruby-identifier">existing</span> = <span class="ruby-constant">Hash</span>[<span class="ruby-identifier">update</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">k</span>, <span class="ruby-ivar">@temporary</span>[<span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">k</span>)]] }]
  <span class="ruby-identifier">update</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">set_key</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>, <span class="ruby-ivar">@temporary</span>, <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">block_given?</span>
  <span class="ruby-keyword">begin</span>
    <span class="ruby-keyword">yield</span>
  <span class="ruby-keyword">ensure</span>
    <span class="ruby-identifier">existing</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">set_key</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>, <span class="ruby-ivar">@temporary</span>, <span class="ruby-keyword">nil</span>) }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate-21-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 305</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate!</span>
  <span class="ruby-identifier">all</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">raw_key</span><span class="ruby-operator">|</span>
    [<span class="ruby-ivar">@local_config</span>, <span class="ruby-ivar">@env_config</span>, <span class="ruby-ivar">@global_config</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">settings</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">value</span> = <span class="ruby-identifier">value_for</span>(<span class="ruby-identifier">raw_key</span>, <span class="ruby-identifier">settings</span>)
      <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">validate!</span>(<span class="ruby-identifier">raw_key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">settings</span>.<span class="ruby-identifier">dup</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-array_to_s" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">array_to_s</span><span
                                class="method-args">(array)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="array_to_s-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 388</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">array_to_s</span>(<span class="ruby-identifier">array</span>)
  <span class="ruby-identifier">array</span> = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">array</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">array</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">array</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;:&quot;</span>).<span class="ruby-identifier">tr</span>(<span class="ruby-string">&quot; &quot;</span>, <span class="ruby-string">&quot;:&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-configs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">configs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="configs-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 320</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">configs</span>
  <span class="ruby-ivar">@configs</span> <span class="ruby-operator">||=</span> {
    <span class="ruby-value">:temporary</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@temporary</span>,
    <span class="ruby-value">:local</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@local_config</span>,
    <span class="ruby-value">:env</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@env_config</span>,
    <span class="ruby-value">:global</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@global_config</span>,
    <span class="ruby-value">:default</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-constant">DEFAULT_CONFIG</span>,
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converted_value" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converted_value</span><span
                                class="method-args">(value, key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="converted_value-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 414</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converted_value</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">is_array</span>(<span class="ruby-identifier">key</span>)
    <span class="ruby-identifier">to_array</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">is_bool</span>(<span class="ruby-identifier">key</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;false&quot;</span>
    <span class="ruby-identifier">to_bool</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">is_num</span>(<span class="ruby-identifier">key</span>)
    <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_i</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-global_config_file" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">global_config_file</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="global_config_file-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 453</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">global_config_file</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_CONFIG&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_CONFIG&quot;</span>].<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_CONFIG&quot;</span>])
  <span class="ruby-keyword">elsif</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_USER_CONFIG&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_USER_CONFIG&quot;</span>].<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_USER_CONFIG&quot;</span>])
  <span class="ruby-keyword">elsif</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_USER_HOME&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_USER_HOME&quot;</span>].<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_USER_HOME&quot;</span>]).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;config&quot;</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">user_home</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">user_home</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">user_home</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;.bundle/config&quot;</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-is_array" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">is_array</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="is_array-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 371</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_array</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-constant">ARRAY_KEYS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-is_bool" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">is_bool</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="is_bool-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 346</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_bool</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-constant">BOOL_KEYS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">||</span> <span class="ruby-constant">BOOL_KEYS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">parent_setting_for</span>(<span class="ruby-identifier">name</span>))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-is_credential" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">is_credential</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="is_credential-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 375</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_credential</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;gem.push_key&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-is_num" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">is_num</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="is_num-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 367</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_num</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-constant">NUMBER_KEYS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-is_string" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">is_string</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="is_string-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 351</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_string</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-constant">STRING_KEYS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;local.&quot;</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;mirror.&quot;</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;build.&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-is_userinfo" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">is_userinfo</span><span
                                class="method-args">(value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="is_userinfo-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 379</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_userinfo</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-identifier">value</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;:&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load_config" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_config</span><span
                                class="method-args">(config_file)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_config-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 469</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_config</span>(<span class="ruby-identifier">config_file</span>)
  <span class="ruby-keyword">return</span> {} <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">config_file</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">ignore_config?</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">config_file</span>, <span class="ruby-value">:read</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">valid_file</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">file</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">zero?</span>
    <span class="ruby-keyword">return</span> {} <span class="ruby-keyword">unless</span> <span class="ruby-identifier">valid_file</span>
    <span class="ruby-identifier">serializer_class</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">file</span>.<span class="ruby-identifier">read</span>).<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">config</span>, (<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)<span class="ruby-operator">|</span>
      <span class="ruby-identifier">new_k</span> = <span class="ruby-identifier">k</span>

      <span class="ruby-keyword">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;-&quot;</span>)
        <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Your #{file} config includes `#{k}`, which contains the dash character (`-`).\n&quot;</span> \
          <span class="ruby-string">&quot;This is deprecated, because configuration through `ENV` should be possible, but `ENV` keys cannot include dashes.\n&quot;</span> \
          <span class="ruby-node">&quot;Please edit #{file} and replace any dashes in configuration keys with a triple underscore (`___`).&quot;</span>

        <span class="ruby-identifier">new_k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&quot;-&quot;</span>, <span class="ruby-string">&quot;___&quot;</span>)
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">config</span>[<span class="ruby-identifier">new_k</span>] = <span class="ruby-identifier">v</span>
      <span class="ruby-identifier">config</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-local_config_file" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">local_config_file</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="local_config_file-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 465</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">local_config_file</span>
  <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@root</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;config&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@root</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-parent_setting_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parent_setting_for</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="parent_setting_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 334</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parent_setting_for</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">split_specific_setting_for</span>(<span class="ruby-identifier">name</span>)[<span class="ruby-value">0</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-printable_value" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">printable_value</span><span
                                class="method-args">(value, key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="printable_value-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 430</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">printable_value</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">converted</span> = <span class="ruby-identifier">converted_value</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">converted</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">converted</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">is_string</span>(<span class="ruby-identifier">key</span>)
    <span class="ruby-identifier">converted</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">is_credential</span>(<span class="ruby-identifier">key</span>)
    <span class="ruby-string">&quot;[REDACTED]&quot;</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">is_userinfo</span>(<span class="ruby-identifier">converted</span>)
    <span class="ruby-identifier">username</span>, <span class="ruby-identifier">pass</span> = <span class="ruby-identifier">converted</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;:&quot;</span>, <span class="ruby-value">2</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">pass</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;x-oauth-basic&quot;</span>
      <span class="ruby-identifier">username</span> = <span class="ruby-string">&quot;[REDACTED]&quot;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">pass</span> = <span class="ruby-string">&quot;[REDACTED]&quot;</span>
    <span class="ruby-keyword">end</span>

    [<span class="ruby-identifier">username</span>, <span class="ruby-identifier">pass</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;:&quot;</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">converted</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-serializer_class" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">serializer_class</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="serializer_class-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 491</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">serializer_class</span>
  <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;rubygems/yaml_serializer&quot;</span>
  <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">YAMLSerializer</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">LoadError</span>
  <span class="ruby-comment"># TODO: Remove this when RubyGems 3.4 is EOL</span>
  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;yaml_serializer&quot;</span>
  <span class="ruby-constant">YAMLSerializer</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_key" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_key</span><span
                                class="method-args">(raw_key, value, hash, file)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_key-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 394</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_key</span>(<span class="ruby-identifier">raw_key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">hash</span>, <span class="ruby-identifier">file</span>)
  <span class="ruby-identifier">raw_key</span> = <span class="ruby-identifier">raw_key</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-identifier">value</span> = <span class="ruby-identifier">array_to_s</span>(<span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">is_array</span>(<span class="ruby-identifier">raw_key</span>)

  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">raw_key</span>)

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">value</span>

  <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
  <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>

  <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">validate!</span>(<span class="ruby-identifier">raw_key</span>, <span class="ruby-identifier">converted_value</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">raw_key</span>), <span class="ruby-identifier">hash</span>)

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">file</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">p</span>.<span class="ruby-identifier">dirname</span>)
    <span class="ruby-identifier">p</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;w&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">serializer_class</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">hash</span>)) }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specific_gem_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specific_gem_for</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specific_gem_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 338</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specific_gem_for</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">split_specific_setting_for</span>(<span class="ruby-identifier">name</span>)[<span class="ruby-value">1</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-split_specific_setting_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">split_specific_setting_for</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="split_specific_setting_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 342</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">split_specific_setting_for</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;.&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_array" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_array</span><span
                                class="method-args">(value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_array-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 383</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_array</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">return</span> [] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>
  <span class="ruby-identifier">value</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-string">&quot; &quot;</span>, <span class="ruby-string">&quot;:&quot;</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;:&quot;</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:to_sym</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_bool" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_bool</span><span
                                class="method-args">(value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_bool-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 356</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_bool</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
    <span class="ruby-identifier">value</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-regexp">/\A(false|f|no|n|0|)\z/i</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword">false</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-value_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">value_for</span><span
                                class="method-args">(name, config)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="value_for-source">
            <pre><span class="ruby-comment"># File bundler/settings.rb, line 330</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">value_for</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">config</span>)
  <span class="ruby-identifier">converted_value</span>(<span class="ruby-identifier">config</span>[<span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">name</span>)], <span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

